import React, { FC } from "react"
import { createStackNavigator } from "@react-navigation/stack"
import { RootStackParamList } from "../../types"
import BottomTabNavigator from "./BottomTabNavigator"
import NotFoundScreen from "../../screens/NotFoundScreen"
/**
 * 根导航
 * https://reactnavigation.org/docs/modal
 */
const Stack = createStackNavigator<RootStackParamList>()
const { Navigator, Screen } = Stack

const RootNavigator: FC = () => (
  <Navigator screenOptions={{ headerShown: false }}>
    <Screen name="Root" component={BottomTabNavigator} />
    <Screen
      name="NotFound"
      component={NotFoundScreen}
      options={{ title: "Oops!" }}
    />
  </Navigator>
)

export default RootNavigator
